package com.itrus.spring.dependency;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Aspect
@Component
@EnableAspectJAutoProxy
public class LoggingAspect {

    // 定义一个前置通知，在目标方法执行前执行
    @Before("execution(* com.itrus.spring.dependency.*.*(..))")
    public void logBefore(JoinPoint joinPoint) {
        System.out.println("前置通知：即将执行方法 " + joinPoint.getSignature().getName());
    }
}